package com.sojson.util.search.es.test;

import java.util.Date;
import java.util.List;

import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.Mapping;
import org.springframework.data.elasticsearch.annotations.Setting;

import com.sojson.util.annotation.AnnoUtil;
import com.sojson.util.search.es.bean.EsBaseBean;
import com.sojson.util.search.es.util.EsUtil;

import lombok.Data;

/**
 * ES测试Bean
 * 
 * @author liu
 * @date 2022-07-21
 */
@Data
@Mapping(mappingPath = "es/mapping/model.json")
@Setting(settingPath = "es/setting/default.json")
@Document(indexName = EsUtil.INDEX_NAME_ANNO_PREFIX + "test" + AnnoUtil.VALUE_PARAM_SUFFIX, createIndex = false)
public class EsModel extends EsBaseBean {

    /**  */
    private static final long serialVersionUID = 1L;
    @Id
    @Field(name = "ID")
    private String id;
    @Field(name = "NAME")
    private String name;
    @Field(name = "AGE")
    private Integer age;
    @Field(name = "IS_ADMIN")
    private Boolean isAdmin;
    @Field(name = "DATE")
    private Date date;
    @Field(name = "DATE_STR")
    private String dateStr;
    @Field(name = "POINT")
    private GeoPoint point;
    @Field(name = "NAMES")
    private List<String> names;
    @Field(name = "AGES")
    private List<Integer> ages;
    @Field(name = "CHILDS")
    private List<EsModelChild> childs;
    /** 距离 */
    private Double distance;

}